$(".menu li").hover(
    function () {
        $(this).children("a.title").addClass("checked");
        $(this).children(".subMenu").css("display","block");
    },
    function () {
        $(this).children("a.title").removeClass("checked");
        $(this).children(".subMenu").css("display","none");
    }
)
$(".subMenu li").hover(
    function () {
        $(this).children("a").addClass("checked");
    },
    function () {
        $(this).children("a").removeClass("checked");
    }
)
//个人中心
/*$("#perCenter-nav li a").click(
    function () {
       var index =$("#perCenter-nav li a").index($(this));
        $("#perCenter-nav li a").removeClass("checked-nav");
        $(this).addClass("checked-nav");
        $(".perCenter-content .page").css("display","none");
        $($(".perCenter-content .page")[index]).css("display","block");
    }
)*/
//数量加减
$("#addition").click(function () {
    var num=$("#num-value").val();
    num=parseInt(num)+1;
    $("#num-value").val(num);
})
$("#subtraction").click(function () {
    var num=$("#num-value").val();
   if(num>0){
       num=parseInt(num)-1;
       $("#num-value").val(num);
   }

})



// 个人中心
$(document).on('click','#perCenter-nav li a.perCenter-nav1',function () {
    var index =$("#perCenter-nav li a.perCenter-nav1").index($(this));
    $("#perCenter-nav li a").removeClass("checked-nav");
    $(this).addClass("checked-nav");
    $(".perCenter-nav-child li a").removeClass("perCenter-nav-childCkd");
    $("#perCenter-nav li a.perCenter-nav1:not(.checked-nav)").next(".perCenter-nav-child").hide();

    $($("#perCenter-nav li a.perCenter-nav1")[index]).next(".perCenter-nav-child").slideToggle();
    var eachId=$(this).attr("id");
    if(eachId=="order"){
        $(".perCenter-content").load("order.html");
    }
    else if(eachId=="information"){
        $(".perCenter-content").load("information.html");
    }else if(eachId=="updatePass"){
        $(".perCenter-content").load("updatePassword.html");
    }else if(eachId=="billingAdress"){
        $(".perCenter-content").load("billingAdress.html");
    }else if(eachId=="register"){
        $(".perCenter-content").load("register.html");
    }
    else if(eachId=="accout-trans"){
        $(".perCenter-content").load("accout-trans.html");
    }

    else if(eachId=="trans-assets"){
        $(".perCenter-content").load("trans-assets.html");
    }
    else if(eachId=="address-bind"){
        $(".perCenter-content").load("address-bind.html");
    }
    else if(eachId=="return-trans"){
        $(".perCenter-content").load("return-trans.html");
    }
    else if(eachId=="return-account"){
        $(".perCenter-content").load("return-account.html");
    }
    else if(eachId=="activity"){
        $(".perCenter-content").load("activity.html");
    }
    else if(eachId=="charge-vouchers"){
        $(".perCenter-content").load("charge-vouchers.html");
    }

    else if(eachId=="Live-stream"){
        $(".perCenter-content").load("Live-stream.html");
    }
    else if(eachId=="recommend"){
        $(".perCenter-content").load("recommend.html");
    }
})


$(".perCenter-nav-child li a").click(function () {
    var index =$(".perCenter-nav-child li a").index($(this));
    $(".perCenter-nav-child li a").removeClass("perCenter-nav-childCkd");
    $(this).addClass("perCenter-nav-childCkd");
    var eachId=$(this).attr("id");

    if(eachId=="account"){
        $(".perCenter-content").load("account.html");
    }else if(eachId=="charge"){
        $(".perCenter-content").load("charge.html");
    } else if(eachId=="transferMoney"){
        $(".perCenter-content").load("transferMoney.html");
    }
    else if(eachId=="updateLoginPassw"){
        $(".perCenter-content").load("updateLoginPassw.html");
    }
    else if(eachId=="updatePayPass"){
        $(".perCenter-content").load("updatePayPass.html");
    }
    else if(eachId=="wargetPayPass"){
        $(".perCenter-content").load("wargetPayPass.html");
    }
    else if(eachId=="already-accout"){
        $(".perCenter-content").load("already-accout.html");
    }
    else if(eachId=="account-bind"){
        $(".perCenter-content").load("account-bind.html");
    }
    else if(eachId=="goodsAddress"){
        $(".perCenter-content").load("updateOrderAddress.html");
    }
    else if(eachId=="addShipAddress"){
        $(".perCenter-content").load("addShipAddress.html");
    }
})



